Apparatus and method for dynamically providing hub or host operations

ABSTRACT

An apparatus and method for coupling a host computer to one or more peripherals or for coupling peripherals to one another. In one example, the apparatus includes a hub having an upstream port for coupling with the host computer and one or more downstream ports for coupling with the one or more peripherals; and a local host dynamically coupled with the upstream port. In one example, when the host computer is not coupled with the upstream port, the local host communicates with the peripherals; and when the host computer is coupled with the upstream port, the local host disconnects from the upstream port so that the host computer communicates with the peripherals through the hub. In this manner, the apparatus may be used to couple peripherals to a host computer, or when a host computer is not present, the data from the peripherals may be communicated through the local host. Other embodiments are also disclosed.

TECHNICAL FIELD

This application relates, in general, to USB devices including hosts,hubs, and peripherals.

BACKGROUND

The universal serial bus (USB) provides a low cost solution forattaching peripheral devices to a host, such as a host computer (i.e.,personal computer such as a laptop or desktop or other host) or hostserver, so that the peripheral devices and the host can communicate witheach other. Devices that are attached to a USB bus are automaticallydetected and software automatically configures the devices for immediateuse, typically without user intervention. The USB devices/peripheralsmay include devices such as printers, scanners, keyboards, a mouse,digital cameras, digital video cameras, data acquisition devices,modems, speakers, telephones or video phones, storage devices such asZIP drives, or other peripherals or devices.

Typically, a USB bus may include a host computer connected by a USBcable to one or more peripherals/devices or hubs. A USB bus can beextended with a hub which permits additions peripherals, or other hubs,to be coupled to the USB bus. By convention, data transmitted in thedirection of the peripheral device is said to be in the “downstream”direction, while data transmitted in the direction of the host computeris said to be in the “upstream” direction.

When multiple peripherals are coupled to a USB bus, each peripheraltypically only sees messages or data from the host computer which isintended for the peripheral. For instance, in FIG. 1, a host computer20, having printing software 21, is coupled with a printer 22 have beena USB printer engine 24 and a flash media card reader 26 coupled thewith the host computer 20 through hub of 28. When a flash media card isinserted into reader 26, host computer 20 obtains the data from thereader 26 and effects printer engine 24 to print of one or more imagesusing printing software 21. In this example, printer engine 24 andreader 26 are typically not able to communicate with one another unlesshost computer 20 is provided, and even in that instance, each peripheralcommunicates 24, 26 with the host computer 20 and the host computer 20determines what data should be sent to particular peripherals.

Recently, an extension to the USB specification includes an “on the go”(OTG) feature which permits two USB devices coupled to one another tocommunicate with one another without the presence of a host computer.FIG. 2 illustrates one example of such a configuration, wherein a USBprinter 30 is coupled with a flash media card reader 32 with OTGcapabilities, wherein reader 32 may operate as a host in thisconfiguration to control the printer 30. While OTG capabilities of thesystem of FIG. 2 allows devices 30, 32 to communicate with one another,the configuration of FIG. 2 does not support the dynamic addition of thetwo devices to a USB bus controlled by a host computer.

Accordingly, as recognized by the present inventor, what is needed is amethod and apparatus for USB peripherals to communicate with each otherwhen no host computer is present, or to communicate with a host computerif present.

It is against this background that various embodiments of the presentinvention were developed.

SUMMARY

According to one broad aspect of one embodiment of the presentinvention, disclosed herein is an apparatus for coupling a host computerto one or more peripherals. In one example, the apparatus includes a hubhaving an upstream port for coupling with the host computer and one ormore downstream ports for coupling with the one or more peripherals; anda local host dynamically coupled with the upstream port, the local hosthaving a detector for determining whether the host computer is coupledwith the upstream port. In one example, when the host computer is notcoupled with the upstream port, the local host communicates with theperipherals; and when the host computer is coupled with the upstreamport, the local host disconnects from the upstream port so that the hostcomputer communicates with all the peripherals through the hub. In thismanner, the apparatus may be used to couple peripherals to a hostcomputer, or when a host computer is not present, the data from theperipherals may be communicated through the local host.

In one embodiment, when the host computer is coupled with the upstreamport, the local host may enter a low-power mode. The upstream port mayinclude a Vbus line, and the detector may include a voltage detectordetecting a voltage level on the Vbus line. For example, the voltagedetector may detect a voltage in the range of approximately 4.35 to 5.25volts as a condition indicating that the host computer is coupled withthe upstream port, and a voltage in the range of approximately 0 voltsas a condition indicating that the host computer is not coupled with theupstream port.

In another example, the apparatus may also include a microcontrollercoupled with the local host and the hub, the microcontroller forcontrolling the hub when the host computer is not coupled with theupstream port. The microcontroller may be specially adapted for use withparticular peripherals—such as digital cameras and color printers—suchthat the microcontroller contains operations for facilitatingcommunications between the peripherals when the host computer is notpresent. In one embodiment, when the host computer is not coupled withthe upstream port, the microcontroller performs one or more operationsto permit data to be transferred from a first of the one or moreperipheral devices to a second of the one or more peripheral devices.

According to another broad aspect of another embodiment of the presentinvention, disclosed herein is an apparatus for coupling a host computerto one or more peripherals. In one embodiment, the apparatus includes ahub and a local host. The hub may have an upstream port for couplingwith the host computer and one or more downstream ports for couplingwith the one or more peripherals, the hub determining and indicatingwhether the host computer is coupled with the upstream port; and thelocal host may be dynamically coupled with the downstream ports, thelocal host receiving an indication from the hub whether the hostcomputer is coupled with the upstream port, and when the host computeris not coupled with the upstream port, the local host communicates withthe peripherals. The local host may disconnect from the downstream portswhen the host computer is coupled with the upstream port, and may alsoenter a low-power mode in one example. In another example, when the hostcomputer is not coupled with the upstream port, the hub may enter alow-power mode.

In another embodiment, the apparatus may also include a microcontrollercoupled with the local host and the hub, the microcontroller forcontrolling the hub when the host computer is not coupled with theupstream port. The microcontroller may be specially adapted for use withparticular peripherals—such as digital cameras and color printers—suchthat the microcontroller contains operations for facilitatingcommunications between the peripherals when the host computer is notpresent. In one example, when the host computer is not coupled with theupstream port, the microcontroller performs one or more operations topermit data to be transferred from a first of the one or more peripheraldevices to a second of the one or more peripheral devices through thelocal host.

According to another broad aspect of another embodiment of the presentinvention, disclosed herein is a method for use with a USB bus adaptedfor a host computer and one or more peripherals. In one example, themethod includes providing a local host, providing a hub coupled with theperipherals, detecting whether the host computer is present on the bus;and if the host computer is present, dynamically configuring the localhost so that the host computer communicates with the peripherals throughthe hub. If the host computer is not present, the local host may bedynamically configured so that the local host communicates with theperipherals through the hub. In one example, if the host computer ispresent, the local host may be placed in a low-power mode.

The operation of providing a hub may include providing an upstream portfor coupling with the host computer and one or more downstream ports forcoupling with the peripherals, and the operation of providing a localhost may include coupling the local host with the upstream port, so thatwhen the host computer is present, the local host may be disconnectedfrom the upstream port. In another example, the operation of providing ahub may include providing an upstream port for coupling with the hostcomputer and one or more downstream ports for coupling with theperipherals, and the operation of providing a local host may includecoupling the local host with the downstream ports, so that when the hostcomputer is present, the local host is disconnected from the downstreamports. If the host computer is not present, data may be transferred froma first of the one or more peripheral devices to a second of the one ormore peripheral devices through the local host.

The foregoing and other features, utilities and advantages of theinvention will be apparent from the following more particulardescription of various embodiments of the invention as illustrated inthe accompanying drawings and claims.

DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a block diagram of a USB bus including a hostcomputer, hub, and printer.

FIG. 2 illustrates a block diagram of a printer coupled with a flashmedia card reader, both having OTG capabilities.

FIG. 3 illustrates an example of logical operations for dynamicallyproviding hub or host capabilities, in accordance with one embodiment ofthe present invention.

FIG. 4 illustrates an example of logical operations for providing hubcapabilities when an external host computer is present, in accordancewith one embodiment of the present invention.

FIG. 5 illustrates an example of logical operations for providing hostcapabilities when an external host computer is not present, inaccordance with one embodiment of the present invention.

FIG. 6 illustrates a block diagram of one example of an apparatus fordynamically providing hub or host capabilities, in accordance with oneembodiment of the present invention.

FIG. 7 illustrates a block diagram of another example of an apparatusfor dynamically providing hub or host capabilities, in accordance withone embodiment of the present invention.

DETAILED DESCRIPTION

Disclosed herein is a method and apparatus for coupling a host computerto one or more peripherals or for coupling peripherals to one another.In one example, a local host is provided, a hub is coupled with theperipherals, and it is determined whether the host computer is presenton the bus; and if the host computer is present, the local host isdynamically configured so that the host computer communicates with theperipherals through the hub. If the host computer is not present, thelocal host may be dynamically configured so that the local hostcommunicates with the peripherals through the hub. In this manner,embodiments of the invention may be used to couple peripherals to a hostcomputer, or when a host computer is not present, the data from theperipherals may be communicated through the local host. Variousembodiments of the present invention will now be described.

Referring to FIG. 3, one example of logical operations for dynamicallyproviding hub or host capabilities is illustrated in accordance with anembodiment of the present invention. At operation 40, a local host isprovided, and at operation 42 a hub is provided. In one embodiment, thehub includes an upstream port adapted to be coupled with a host computersuch as a personal computer, laptop computer, desktop computer, orserver, and the hub may include one or more downstream ports adapted tobe coupled with one or more peripherals. While the term host computer isused throughout this application, it is understood that the presentinvention could be used with other host devices such as a host server orother types of hosts. In one example, the local host is coupled with theupstream port of the hub; alternatively, the local host may be coupledwith the downstream ports of the hub.

At operation 44, a determination is made whether the host computer iscoupled with the hub (i.e., whether a host computer is present in thesystem). In one example, the local host detects the presence of the hostcomputer by examining the state of one or more signal lines of theupstream port of the hub, such as Vbus line wherein a voltage in therange of approximately 4.35 to 5.25 volts indicates that the hostcomputer is coupled with the upstream port, and a voltage in the rangeof approximately 0 volts indicates that the host computer is not coupledwith the upstream port. In another embodiment, a weak pull-up resistor(e.g., 1 M Ohm) is provided on both the signal lines D+ and D−connecting these lines to the bus voltage line Vbus, then if both D+ andD− are high it may be inferred that no host computer is coupled with thehub (since a USB host computer would pull D+ and D− down to 0 volts). Inanother example, the hub detects the presence of the host computercoupled to the upstream port of the hub, and indicates such presence tothe local host.

If the host computer detected to be present by operation 44, thenoperation 46 configures the local host so that the host computer maycommunicate with the peripherals using the hub. In one example, wherethe local host is coupled with the upstream port of the hub, when thehost computer is detected by operation 44, the local host disconnectsfrom the upstream port of the hub. Alternatively, where the local hostis coupled with the downstream ports of the hub, when the host computeris detected by operation 44, the local host disconnects from thedownstream ports of the hub. In this manner, operation 46 permits thehost computer to communicate with the peripherals through the hub, andthe local host is effectively disconnected from the USB bus.

If, however, the host computer is detected to not be present byoperation 44, then operation 48 configures the local host so that theperipherals may communicate with each other through the local host. Inthis situation, the local host may act as a host for the peripherals(i.e., if the local host is provided with program code to perform one ormore operations to act as a host for the peripherals), or the local hostmay behave as a bridge so as to facilitate “on the go” (OTG)communications between the peripherals. In one example, data from afirst peripheral may be made available to a second peripheral throughthe local host at operation 48. Accordingly, it can be seen that theoperations of FIG. 3 permits peripherals to communicate with a hostcomputer or to communicate with each other if a host computer is notpresent.

FIG. 4 illustrates an example of logical operations which may beperformed by the local host when a host computer is detected on the USBbus. At operation 50, the connections of the local host to the USB busare placed in a high impedance state so as to effectively disconnect thelocal host from the USB bus. Operation 50 thereby allows the hostcomputer to drive and control the USB bus. At operation 52, the localhost may be placed in a low-power mode, and at operation 54, the stateof the presence of the host computer may be continually or periodicallymonitored to determine if the host computer is disconnected from the USBbus, in which case control may be returned to operation 48 of FIG. 3, inone example.

FIG. 5 illustrates an example of logical operations which may beperformed by the local host when a host computer is not detected on theUSB bus. At operation 60, the local host may acquire data about the huband the attached peripherals. In one example where the local host iscoupled to the upstream port of the hub, the local host may enumeratethe hub so as to determine how many ports are associated with the hub,and obtain information from the hub as to how many devices are connectedwith the hub. The local host may also enable ports of the hub andenumerate each device connected to ports of the hub. In another examplewhere the local host is coupled to the downstream ports of the hub, thelocal host may communicate directly with the peripheral devices attachedto the downstream ports of the hub.

At operation 62, the local host communicates with and/or between theperipherals so as to pass data or information between the peripheraldevices. In one example, the local host is configured to supportparticular peripheral devices and provided specific features, forexample the local host may be adapted to support communications betweena digital camera and a printer, or a flash media card reader and aprinter, or other peripheral devices which in combination may provideuseful functions to a user. In this example, the local host may act as ahost for the peripherals. In another example, the local host may behaveas a communications link or bridge so as to facilitate “on the go” (OTG)communications between the peripherals, where the peripherals have OTGcapabilities.

At operation 64, the state of the non-presence of the host computer iscontinually or periodically monitored so that if a host computer iscoupled to the upstream port of the hub, then control may be returned tooperation 46, in one example.

Referring now to FIG. 6, one example of an apparatus 70 for coupling ahost computer 72 to a plurality of peripherals 74 is shown, inaccordance with one embodiment of the present invention. In thisexample, the apparatus 70 includes a hub 76 having an upstream port 78adapted to be coupled with the host computer 72 and downstream ports 80adapted to be coupled with the peripherals 74. A local host 82 iscoupled with the upstream port 78 of hub 76, and local host 82 includesa detector 84 for detecting the presence or absence of host computer 72on the upstream port 78. The upstream port 78 may include a Vbus line86, and the detector 84 may include a voltage detector detecting avoltage level on the Vbus line 86. For example, the detector 84 maydetect a high voltage signal level for example in the range ofapproximately 4.35 to 5.25 volts as a condition indicating that the hostcomputer 72 is coupled with the upstream port 78, and a low voltagesignal level in the range of approximately 0 volts as a conditionindicating that the host computer 72 is not coupled with the upstreamport 78.

In operation, when detector 84 detects the presence of host computer 72coupled with upstream port 78, local host 82 places its connections toupstream port 78 in a high impedance state so as to effectivelydisconnect from the upstream port 78, thereby allowing host computer 72to drive and control the upstream port 78 and communicate with theperipheral 74 through the hub 76. In this example, the local host 82 mayenter a lower power mode if desired.

When detector 84 detects the absence of host computer 72, the local host82 drives and controls the upstream port 78 so that local host 82communicates with peripherals 74 through hub 76, in this example.

A microcontroller 88 may be provided to facilitate communicationsbetween local host 82 and hub 76, in one embodiment. The microcontroller88 may control the hub 76 when the host computer 72 is not coupled withthe upstream port 78. For instance, the microcontroller 88 may configurethe hub 76 to a enable repeating through all downstream ports 80 at alltimes. In this example, such arrangement would relieve the local host 82of the need to enumerate each peripheral device 74 whenever the hostcomputer 72 is removed, for example. In one example, the microcontroller88 is coupled with the local host 82 using an interface which may be astandard interface such as a serial peripheral interface (SPI), an I²Cbus, a parallel interface, a memory mapped interface, or otherconventional interface. The microcontroller 88 may be coupled to the hub76 using an interface which may be a standard interface such as a serialperipheral interface (SPI), an I²C bus, a parallel interface, a memorymapped interface, or other conventional interface.

The microcontroller 88 may also be specially adapted for use withparticular peripherals 74—such as digital cameras and printers or otherperipherals—such that the microcontroller 88 contains operations forfacilitating communications between the peripherals 74 when the hostcomputer 72 is not present. In one example, when the host computer 72 isnot coupled with the upstream port 78, the microcontroller 88 performsone or more operations to permit data to be transferred from a first ofthe one or more peripheral devices 74 to a second of the one or moreperipheral devices 74 through the local host 82 and hub 76. Themicrocontroller 88 may also configure hub 76 and local host 82 to act asa communication bridge between the peripheral devices 74 in order toenable communications between the devices 74.

In one embodiment, local host 82, microcontroller 88, and hub 76 areprovided as a portion of or integrated within a single integratedcircuit.

Referring now to FIG. 7, another example of an apparatus 90 for couplinga host computer 72 to a plurality of peripherals 74 is shown, inaccordance with one embodiment of the present invention. In thisexample, the apparatus 90 includes a hub 92 having an upstream port 94adapted to be coupled with the host computer 72 and downstream ports 96adapted to be coupled with the peripherals 74. A local host 98 iscoupled with the downstream ports 96 of hub 92, and local host 98 mayinclude a plurality of USB serial interface engines (SIEs) in order toreceive and process data from the peripheral devices coupled with thedownstream ports 96. In this example, the hub 92 may determine andindicate whether the host computer 72 is coupled with the upstream port94.

In operation, when the host computer 72 is detected as being coupledwith the upstream port 94 of the hub 92, the local host 98 maydisconnect from the downstream ports 96 by placing its connections todownstream port 96 in a high impedance state, thereby allowing hostcomputer 72 to communicate with the peripheral 74 through the hub 92. Inthis example, the local host 98 may enter a lower power mode if desired.

When the host computer 72 is detected as not being coupled with theupstream port 94 of the hub 92, the local host 98 may be dynamicallycoupled with the downstream ports 96 to drives and controls theperipherals 74. In this example, the hub 96 may place its downstreamports 96 in a high impedance state and enter a low-power mode.

A microcontroller 100 may be provided between local host 98 and hub 92,in one embodiment. The microcontroller 100 may control the hub 92 whenthe host computer 72 is not coupled with the upstream port 94. Forinstance, the microcontroller 100 may configure the hub 92 to place itsdownstream ports in a high-impedance state.

In one example, the microcontroller 100 is coupled with the local host98 using an interface which may be a standard interface such as a serialperipheral interface (SPI), an I²C bus, a parallel interface, a memorymapped interface, or other conventional interface. The microcontroller100 may be coupled to the hub 92 using an interface which may be astandard interface such as a serial peripheral interface (SPI), an I²Cbus, a parallel interface, a memory mapped interface, or otherconventional interface.

The microcontroller 100 may also be specially adapted for use withparticular peripherals 74—such as digital cameras and printers or otherperipherals—such that the microcontroller 100 contains operations forfacilitating communications between the peripherals 74 when the hostcomputer 72 is not present. In one example, when the host computer 72 isnot coupled with the upstream port 94, the microcontroller 100 performsone or more operations to permit data to be transferred from a first ofthe one or more peripheral devices 74 to a second of the one or moreperipheral devices 74 through the local host 98. The microcontroller 100may also configure local host 98 to act as a communication bridgebetween the peripheral devices 74 in order to enable communicationsbetween the devices 74.

In one embodiment, local host 98, microcontroller 100, and hub 92 areprovided as a portion of or integrated within a single integratedcircuit.

Accordingly, it can be seen that various embodiment of the presentinvention provided for, on a dynamic basis, communications between ahost computer and peripherals, or communications between peripherals.

While blocks 88 and 100 have been shown and described as amicrocontroller, it is understood that a microprocessor, programmablelogic, logic, or other electrical circuit may be used in place of amicrocontroller depending upon the particular implementation.

While the methods disclosed herein have been described and shown withreference to particular operations performed in a particular order, itwill be understood that these operations may be combined, sub-divided,or re-ordered to form equivalent methods without departing from theteachings of the present invention. Accordingly, unless specificallyindicated herein, the order and grouping of the operations is not alimitation of the present invention.

While the invention has been particularly shown and described withreference to a preferred embodiment thereof, it will be understood bythose skilled in the art that various other changes in the form anddetails may be made without departing from the spirit and scope of theinvention.

1. An apparatus for coupling a host to one or more peripherals, comprising: a hub having an upstream port for coupling with the host and one or more downstream ports for coupling with the one or more peripherals; and a local host dynamically coupled with said upstream port, said local host provided with program code to perform one or more operations to act as a host for the one or more peripherals when the host is not coupled with the upstream port; wherein when the host is coupled with the upstream port, the local host disconnects from the upstream port so that the host communicates with the one or more peripherals through the hub and the local host is in a low-power mode and the hub operates in a normal power mode to couple the host with the one or more peripherals, and wherein a state of whether the host remains coupled with the upstream port is periodically monitored to detect if the host becomes disconnected from the upstream port.
 2. The apparatus of claim 1, wherein said local host has a detector for determining whether the host is coupled with said upstream port, and when the host is not coupled with the upstream port, the local host communicates with the one or more peripherals.
 3. The apparatus of claim 2, wherein the upstream port includes a Vbus line, and the detector includes a voltage detector detecting a voltage level on the Vbus line.
 4. The apparatus of claim 3, wherein the voltage detector detects a high signal voltage level as a condition indicating that the host is coupled with the upstream port.
 5. The apparatus of claim 1, further comprising: a microcontroller coupled with the local host and the hub, said microcontroller for controlling the hub when the host is not coupled with the upstream port.
 6. The apparatus of claim 5, wherein when the host is not coupled with the upstream port, the microcontroller performs one or more operations to permit data to be transferred from a first of said one or more peripheral devices to a second of said one or more peripheral devices. 